<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"  
      xmlns:h="http://java.sun.com/jsf/html"  
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:c="http://java.sun.com/jsp/jstl/core">

    <h:head>
        <title>City Press</title>
        <link rel="stylesheet" href="#{request.contextPath}/themes/ui-lightness/skin.css" />
    </h:head>
    <h:body>
        <p:layout id="layout" fullPage="true">  
            <p:layoutUnit id="top" position="north" size="100"  resizable="false" closable="false" collapsible="false" style =" text-align : center;">  
                <p:graphicImage url="/images/blog3.jpg"/>
            </p:layoutUnit>  
            <p:layoutUnit id="bottom" position="south" size="100" resizable="false" closable="false" collapsible="false">  
                <p:dock>  
                    <p:menuitem id="loginLink" onclick="dlg.show()" icon="/images/login.jpg" url="#"/>
                    <p:menuitem id="registerLink" onclick="dreg.show()" value="Register" icon="/images/register.jpg" url="#"/>  
                    <p:menuitem id="searchLink" onclick="dSearch.show()" value="Search" icon="/images/search.jpg" url="#"/>        
                </p:dock>
            </p:layoutUnit>  
            <p:layoutUnit id="left" position="west" size="210"  resizable="false" closable="false" collapsible="false">  
                <h:panelGroup id="regMenu" layout="block">
                    <ui:include src="#{loginBean.menu}.xhtml" />
                </h:panelGroup>
            </p:layoutUnit>  
            <p:layoutUnit id="right" position="east" size="200" resizable="false" closable="false" collapsible="false">
                <h:panelGroup id="browseMenu" layout="block">
                    <ui:include src="browsing.xhtml" />
                </h:panelGroup>
            </p:layoutUnit>  
            <p:layoutUnit id="center" position="center">  
                <h:panelGroup id="centerView" >
                    <ui:include src="#{handleRequests.menu}.xhtml" />
                </h:panelGroup>
            </p:layoutUnit>  
        </p:layout>  
        <p:growl id="growl" showDetail="true" life="3000" /> 
        <p:dialog id="dialogLogin" header="Login" widgetVar="dlg" showEffect="fade" hideEffect="fade">  
            <ui:include src="login.xhtml" />
        </p:dialog>
        <p:growl id="growlReg" showDetail="true" life="3000" /> 
        <p:dialog id="dialogRegistration" header="Registration" widgetVar="dreg" showEffect="fade" hideEffect="fade" resizable="false" >
            <ui:include src="register.xhtml" />
        </p:dialog>

        <p:growl id="growlCategory" showDetail="true" life="3000" /> 
        <p:dialog id="dialogCategory" header="Create Category" widgetVar="dCat" showEffect="fade" hideEffect="fade" resizable="false" >
            <ui:include src="createCategory.xhtml" />
        </p:dialog>


        <p:growl id="growlArticle" showDetail="true" life="3000" /> 
        <p:dialog id="dialogArticles" header="Create Article" widgetVar="dArt" showEffect="fade" hideEffect="fade" resizable="false" >
            <ui:include src="createArticle.xhtml" />
        </p:dialog>

        <p:growl id="growlComment" showDetail="true" life="3000" /> 
        <p:dialog id="dialogComment" header="Create Comment" widgetVar="dComm" showEffect="fade" hideEffect="fade" resizable="false" >
            <ui:include src="commentOnArticleMember.xhtml" />
        </p:dialog>
        
        <p:growl id="growlCommentForVisitor" showDetail="true" life="3000" /> 
        <p:dialog id="dialogCommentForVisitor" header="Create Comment" widgetVar="dCommForVisitor" showEffect="fade" hideEffect="fade" resizable="false" >
            <ui:include src="commentOnVisitor.xhtml" />
        </p:dialog>

        <p:growl id="growlDeleteCategories" showDetail="true" life="3000" /> 
        <p:dialog id="dialogDeleteCategories" header="Edit/Delete Categories" widgetVar="dDeleteCat" showEffect="fade" hideEffect="fade" resizable="false" >
            <ui:include src="view_delete_OwnCategories.xhtml" />
        </p:dialog>

        <p:growl id="growlDeleteArticles" showDetail="true" life="3000" /> 
        <p:dialog id="dialogDeleteArticles" header="Edit/Delete Articles" widgetVar="dDeleteArt" showEffect="fade" hideEffect="fade" resizable="false" >
            <ui:include src="view_delete_OwnArticles.xhtml" />
        </p:dialog>

        <p:growl id="growlEditProfile" showDetail="true" life="3000" /> 
        <p:dialog id="dialogEditProfile" header="Edit Profile" widgetVar="dEditProf" showEffect="fade" hideEffect="fade" resizable="false" >
            <ui:include src="editProfile.xhtml" />
        </p:dialog>

        <p:growl id="growlBrowseByAuthor" showDetail="true" life="3000" /> 
        <p:dialog id="dialogBrowseByAuthor" header="Browse By Author" widgetVar="dBrowseByAuthor" showEffect="fade" hideEffect="fade" resizable="false" >
            <ui:include src="browseByAuthor.xhtml" />
        </p:dialog>

        <p:growl id="growlBrowseByMonth" showDetail="true" life="3000" /> 
        <p:dialog id="dialogBrowseByMonth" header="Browse By Month" widgetVar="dBrowseByMonth" showEffect="fade" hideEffect="fade" resizable="false" >
            <ui:include src="browseByMonth.xhtml" />
        </p:dialog>

        <p:growl id="growlBrowseByCategory" showDetail="true" life="3000" /> 
        <p:dialog id="dialogBrowseByCategory" header="Browse By Month" widgetVar="dBrowseByCategory" showEffect="fade" hideEffect="fade" resizable="false" >
            <ui:include src="browseByCategory.xhtml" />
        </p:dialog>

        <p:growl id="growlSearch" showDetail="true" life="3000" /> 
        <p:dialog id="dialogSearch" header="Search" widgetVar="dSearch" showEffect="fade" hideEffect="fade" resizable="false" >
            <ui:include src="search.xhtml" />
        </p:dialog>

        <p:growl id="growlCommentPage" showDetail="true" life="3000" /> 
        <p:dialog id="dialogCommentPage" header="Comment" widgetVar="dCommentOnPage" showEffect="fade" hideEffect="fade" resizable="false" >
            <ui:include src="commentOnPage.xhtml" />
        </p:dialog>
        
        
        <p:growl id="growlCommentPageVisitor" showDetail="true" life="3000" /> 
        <p:dialog id="dialogCommentPageVisitor" header="Comment" widgetVar="dCommentOnPageVisitor" showEffect="fade" hideEffect="fade" resizable="false" >
            <ui:include src="commentOnPageVisitor.xhtml" />
        </p:dialog>

        <p:growl id="growlEditCategory" showDetail="true" life="3000" /> 
        <p:dialog id="dialogEditCategory" header="Edit Category" widgetVar="dEditCategory" showEffect="fade" hideEffect="fade" resizable="false" >
            <ui:include src="editCategory.xhtml" />
        </p:dialog>

        <p:growl id="growlEditArticle" showDetail="true" life="3000" /> 
        <p:dialog id="dialogEditArticle" header="Edit Article" widgetVar="dEditArticle" showEffect="fade" hideEffect="fade" resizable="false" >
            <ui:include src="editArticles.xhtml" />
        </p:dialog>

        <script type="text/javascript">  
            function handleLoginRequest(xhr, status, args) {  
                if(args.validationFailed || !args.loggedIn) {  
                    jQuery('#dialogLogin').parent().effect("shake", { times:3 }, 100);  
                } else {  
                    dlg.hide();  
                }  
            }  
        </script> 
    </h:body>
</html>

